package cn.com.chengmandian.bike.service;

import cn.com.chengmandian.bike.model.EbDeviceBike;
import cn.com.chengmandian.bike.model.EbRentOrder;
import cn.com.chengmandian.bike.model.EbRideCommand;
import cn.com.chengmandian.bike.model.EbRideOrder;
import cn.com.chengmandian.service.bike.constants.DeviceCommandEnum;
import cn.com.chengmandian.service.bike.constants.RideCommandStatusEnum;
import cn.com.chengmandian.service.bike.constants.RideCommandTypeEnum;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;

/**
 * <p>
 * 电单车运营订单指令 服务类
 * </p>
 *
 * @author AutoGenerator
 * @since 2021-12-11
 */
public interface IEbRideCommandService extends IService<EbRideCommand> {

    EbRideCommand addCommand(EbRideOrder rideOrder, DeviceCommandEnum open, Integer userType, Integer userId, String userName);

    EbRideCommand addCommand(EbRentOrder rentOrderOrder, DeviceCommandEnum open, Integer userType, Integer userId, String userName, Date startTime);

    EbRideCommand getCommand(Integer orderId, Integer command, RideCommandStatusEnum status, RideCommandTypeEnum commandTypeEnum);

    EbRideCommand getCommand(Integer orderId, DeviceCommandEnum command, RideCommandStatusEnum status, RideCommandTypeEnum commandTypeEnum);

    void startCommand(Integer id, String failReason);

    void failCommand(Integer id, String failReason);

    void endCommand(EbRideCommand rideCommand);

    void orderOpenCommand(EbDeviceBike deviceBike, EbRideOrder rideOrder, EbRideCommand rideCommand, String remark);

    void orderStopCommand(EbDeviceBike deviceBike, EbRideOrder rideOrder, EbRideCommand stopInitCommand , Integer closeUserType);

    void orderStopCommandPush(EbRideOrder rideOrder, Integer closeUserType);

    void orderCloseCommand(EbDeviceBike deviceBike, EbRideOrder rideOrder, EbRideCommand closeInitCommand, String remark, Integer userType);

    void orderCloseCommand(EbDeviceBike deviceBike, EbRentOrder rentOrder, EbRideCommand closeInitCommand);

    Integer getCommandCount(Integer orderId, DeviceCommandEnum command);
}
